/**
 * 
 */
package org.tiger.springboot.redis.domain;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author liuwenlai
 *
 */
@Component
@ConfigurationProperties(prefix = "spring.redis.cache")
public class RedisPropertyBean {

	/**
	 * 集群的ip 端口
	 */
	private String clusterNodes;

	/**
	 * 单个节点
	 */
	private String singleNode;

	/**
	 * 超时时间
	 */
	private int commandTimeout;

	/**
	 * 最大连接数
	 */
	private int maxTotal;

	/**
	 * 最大空闲连接数
	 */
	private int maxIdle;

	/**
	 * 超时时间
	 */
	private int minIdle;

	/**
	 * 获取连接时最大等待毫秒数,如果该值小于0,则阻塞不确定的时长
	 */
	private int maxWaitMillis;

	/**
	 * 在获取连接时检查连接有效性
	 */
	private boolean testOnBorrow;

	/**
	 * 在连接空闲时检查连接有效性
	 */
	private boolean testWhileIdle;

	/**
	 * @return the clusterNodes
	 */
	public String getClusterNodes() {
		return clusterNodes;
	}

	/**
	 * @param clusterNodes
	 *            the clusterNodes to set
	 */
	public void setClusterNodes(String clusterNodes) {
		this.clusterNodes = clusterNodes;
	}

	/**
	 * @return the singleNode
	 */
	public String getSingleNode() {
		return singleNode;
	}

	/**
	 * @param singleNode
	 *            the singleNode to set
	 */
	public void setSingleNode(String singleNode) {
		this.singleNode = singleNode;
	}

	/**
	 * @return the commandTimeout
	 */
	public int getCommandTimeout() {
		return commandTimeout;
	}

	/**
	 * @param commandTimeout
	 *            the commandTimeout to set
	 */
	public void setCommandTimeout(int commandTimeout) {
		this.commandTimeout = commandTimeout;
	}

	/**
	 * @return the maxTotal
	 */
	public int getMaxTotal() {
		return maxTotal;
	}

	/**
	 * @param maxTotal
	 *            the maxTotal to set
	 */
	public void setMaxTotal(int maxTotal) {
		this.maxTotal = maxTotal;
	}

	/**
	 * @return the maxIdle
	 */
	public int getMaxIdle() {
		return maxIdle;
	}

	/**
	 * @param maxIdle
	 *            the maxIdle to set
	 */
	public void setMaxIdle(int maxIdle) {
		this.maxIdle = maxIdle;
	}

	/**
	 * @return the minIdle
	 */
	public int getMinIdle() {
		return minIdle;
	}

	/**
	 * @param minIdle
	 *            the minIdle to set
	 */
	public void setMinIdle(int minIdle) {
		this.minIdle = minIdle;
	}

	/**
	 * @return the maxWaitMillis
	 */
	public int getMaxWaitMillis() {
		return maxWaitMillis;
	}

	/**
	 * @param maxWaitMillis
	 *            the maxWaitMillis to set
	 */
	public void setMaxWaitMillis(int maxWaitMillis) {
		this.maxWaitMillis = maxWaitMillis;
	}

	/**
	 * @return the testOnBorrow
	 */
	public boolean isTestOnBorrow() {
		return testOnBorrow;
	}

	/**
	 * @param testOnBorrow
	 *            the testOnBorrow to set
	 */
	public void setTestOnBorrow(boolean testOnBorrow) {
		this.testOnBorrow = testOnBorrow;
	}

	/**
	 * @return the testWhileIdle
	 */
	public boolean isTestWhileIdle() {
		return testWhileIdle;
	}

	/**
	 * @param testWhileIdle
	 *            the testWhileIdle to set
	 */
	public void setTestWhileIdle(boolean testWhileIdle) {
		this.testWhileIdle = testWhileIdle;
	}

}
